
package com.platform.common.config;

import cn.hutool.crypto.symmetric.AES;
import com.platform.common.bean.ALiDaYu;
import com.platform.common.core.oss.baen.ALiOSSStorage;
import com.platform.common.core.oss.baen.LocalStorage;
import com.platform.common.core.oss.baen.Qiniu;
import com.platform.common.core.oss.baen.TengXun;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AllArgsConstructor
public class PlatformBeanConfig {

    private final PlatformBasicConfig shopBasicConfig;

    @Bean
    public Qiniu qiniu() {
        return shopBasicConfig.getQiniu();
    }

    @Bean
    public AES tokenAes() {
        return new AES(shopBasicConfig.getTokenAesKey().getBytes());
    }

    @Bean
    public ALiDaYu aLiDaYu() {
        return shopBasicConfig.getALiDaYu();
    }

    @Bean
    public LocalStorage localStorage() {
        return shopBasicConfig.getLocalStorage();
    }

    @Bean
    public ALiOSSStorage aLiOSSStorage() {
        return shopBasicConfig.getALiOSSStorage();
    }

    @Bean
    public TengXun tengXun() {
        return shopBasicConfig.getTengXun();
    }

}
